<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>发布公告</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<%=basePath%>assets/css/dpl-min.css" rel="stylesheet"
	type="text/css" />
<link href="<%=basePath%>assets/css/bui-min.css" rel="stylesheet"
	type="text/css" />
<link href="<%=basePath%>assets/css/page-min.css" rel="stylesheet"
	type="text/css" />
<style type="text/css">
body {
	text-align: center;
	padding: 20px 50px 20px 30px;
}

.doc-content {
	width: 100%;
	height: 150px;
}

.doc-content .panel-header {
	height: 30px;
	letter-spacing: 5px;
	background: #DFF0D8;
}

.doc-content .panel-body {
	height: 120px;
}

.doc-content .panel-body #demo, .doc-content .panel-body #demo1,
	.doc-content .panel-body #demo2 {
	height: 120px;
	padding-left: 150px;
}

.span24 {
	width: 98%;
	margin-top: 70px;
}

.notice {
	width: 100%;
	text-align: left;
}

.table-bordered td, .table-bordered th {
	text-align: center;
}

.table-bordered th {
	background: #DFF0D8;
}

.panel1 .panel-header {
	background: #DFF0D8;
}

.panel1 {
	margin-top: 100px;
}

.panel1 textarea {
	width: 800px;
	height: 100px;
}

.panel1 button {
	margin-top: 5px;
}

.oneSpan {
	display: inline-block;
	margin: 0 10px;
	width: 50px;
}
</style>
</head>
<body>
	<div class="doc-content">
		<div class="panel ">
			<div class="panel-header">
				<h1>最近一周公告</h1>
			</div>
			<div class="panel-body">
				<table class="notice">
					<tr>
						<td>
							<div id="demo" style="overflow: hidden; height: 100px; border: 1px solid #dde5bc;">
								<div id="demo1">
									<s:iterator value="topAnnos" var="one">
										<a href="#">
											<div>
												<font style="font-weight: bold;">&gt;&gt;&gt; <span
													class="oneSpan">
													<s:property value="#one.deptid" /></span>
												</font>&nbsp;&nbsp;&nbsp;&nbsp;
												<s:date name="#one.annotime" format="yyyy-MM-dd HH:mm:ss" />
												&nbsp;&nbsp;发表公告：&nbsp;&nbsp;
												<s:property value="#one.annocontent" />
											</div>
										</a>
									</s:iterator>
								</div>
								<div id="demo2"></div>
							</div> 
							
							<script>
								var speed = 50
								var demo = document.getElementById("demo");
								var demo2 = document.getElementById("demo2");
								var demo1 = document.getElementById("demo1");
								demo2.innerHTML = demo1.innerHTML
								function Marquee() {
									if (demo2.offsetTop - demo.scrollTop <= 0)
										demo.scrollTop -= demo1.offsetHeight
									else {
										demo.scrollTop++
									}
								}
								var MyMar = setInterval(Marquee, speed)
								demo.onmouseover = function() {
									clearInterval(MyMar)
								}
								demo.onmouseout = function() {
									MyMar = setInterval(Marquee, speed)
								}
							</script>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>

	<div class="panel panel1">
		<div class="panel-header">
			<h3>公告内容</h3>
		</div>
		<div class="panel-body">
			<s:property value="tip" />
			<s:fielderror />
			<form id="form" action="<%=basePath%>anno/add"
				class="form-horizontal">
				<input name="anno.deptid" type="text"
					value="${userInfo.baseGroup.name}">
				<textarea name="anno.annocontent" type="text" placeholder="公告内容..."></textarea>
				<button type="submit" class="button button-default">发布</button>
			</form>
			<br>
		</div>
	</div>
</body>
</html>